package com.itheima.Thread.sleep.时钟;

public class demo {
    public static void main(String[] args) {
       /* MyRunnable mr = new MyRunnable();
        Thread t1 = new Thread(mr);
        Thread t2 = new Thread(mr);*/

        MyRunnable mr = new MyRunnable();

        Thread t1 = new Thread(mr);

        t1.start();

    }
}           //时钟

//休眠的单位时间为毫秒 一秒等于一千毫秒
class MyRunnable implements Runnable {
    @Override
    public void run() {
       /* for (int i = 0; i <= 30; i++) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println( Thread.currentThread().getName() +"="+i);
        }*/
        for (int hour = 0; hour < 24; hour++) {
            for (int minute = 0; minute < 60; minute++) {
                for (int second = 0; second < 60; second++) {
                    System.out.println(hour+"时"+minute+"分"+second+"秒");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }

            }

        }

    }
}